package com.leigang.springboot.kafka.receive;

import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * @program: yaner-boot
 * @description: 接收消息
 * @author: leigang
 * @create: 2020-01-03 00:33
 */
@Component
public class Customer {

    @KafkaListener(topics = "testTopic")
    public void onMessage(String message){
        //insertIntoDb(buffer);//这里为插入数据库代码
        System.out.println("消息是："+message);
    }

}
